﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model;
using HengTong.Model._Admin;
using HengTong.Model.Db.Other;


namespace HengTong.ViewModel.Activity.SysActivityParticipationVms
{
    public partial class SysActivityParticipationTemplateVm : BaseTemplateVM
    {
        [Display(Name = "活动ID")]
        public ExcelPropety ActivityExcel = ExcelPropety.CreateProperty<SysActivityParticipation>(x => x.ActivityId);
        [Display(Name = "参与者类型")]
        public ExcelPropety ParticipantTypeExcel = ExcelPropety.CreateProperty<SysActivityParticipation>(x => x.ParticipantType);
        [Display(Name = "姓名/公司名")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysActivityParticipation>(x => x.Name);
        [Display(Name = "联系电话")]
        public ExcelPropety PhoneExcel = ExcelPropety.CreateProperty<SysActivityParticipation>(x => x.Phone);
        [Display(Name = "详细地址")]
        public ExcelPropety AddressExcel = ExcelPropety.CreateProperty<SysActivityParticipation>(x => x.Address);
        [Display(Name = "描述")]
        public ExcelPropety DescriptionExcel = ExcelPropety.CreateProperty<SysActivityParticipation>(x => x.Description);
        [Display(Name = "绑定用户")]
        public ExcelPropety UserExcel = ExcelPropety.CreateProperty<SysActivityParticipation>(x => x.UserId);

	    protected override void InitVM()
        {
            ActivityExcel.DataType = ColumnDataType.ComboBox;
            ActivityExcel.ListItems = DC.Set<SysActivityList>().GetSelectListItems(Wtm, y => y.ActivityName);
            UserExcel.DataType = ColumnDataType.ComboBox;
            UserExcel.ListItems = DC.Set<FrameworkUser>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysActivityParticipationImportVm : BaseImportVM<SysActivityParticipationTemplateVm, SysActivityParticipation>
    {

    }

}
